package com.example.mvvm.mode;

import android.graphics.Paint;

/**
 * Time: 5/28/2021 10:31
 * Author: TAO
 * Description:
 */
public class Ball {
    private int radius; // 半径
    private float cx;   // 圆心
    private float cy;   // 圆心
    private float vx; // X轴速度
    private float vy; // Y轴速度
    private Paint paint;
    private String content;
    private String taskId;

    // 移动
    public void move() {
        //向角度的方向移动，偏移圆心
        cx += vx;
        cy += vy;
    }

    public int left() {
        return (int) (cx - radius);
    }

    public int right() {
        return (int) (cx + radius);
    }

    public int bottom() {
        return (int) (cy + radius);
    }

    public int top() {
        return (int) (cy - radius);
    }

    public int getRadius() {
        return radius;
    }

    public void setRadius(int radius) {
        this.radius = radius;
    }

    public float getCx() {
        return cx;
    }

    public void setCx(float cx) {
        this.cx = cx;
    }

    public float getCy() {
        return cy;
    }

    public void setCy(float cy) {
        this.cy = cy;
    }

    public float getVx() {
        return vx;
    }

    public void setVx(float vx) {
        this.vx = vx;
    }

    public float getVy() {
        return vy;
    }

    public void setVy(float vy) {
        this.vy = vy;
    }

    public Paint getPaint() {
        return paint;
    }

    public void setPaint(Paint paint) {
        this.paint = paint;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public String getTaskId() {
        return taskId;
    }

    public void setTaskId(String taskId) {
        this.taskId = taskId;
    }
}
